package com.elong.android.specialhouse.activity;

import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.elong.android.specialhouse.R;
//import com.elong.android.youfang.activity.landlord.LandlordTabHomeActivity;
import com.elong.android.specialhouse.base.BaseVolleyActivity;
import com.elong.framework.netmid.response.IResponse;

/**
 * 发表评价成功页
 * 
 * @author cheng.wang
 * @date 2015/9/16 18:39
 */
public class EvaluationSucceedActivity extends BaseVolleyActivity<IResponse<?>> {
	private TextView tvGoHome;

	@Override
	protected void initContentView() {
		setContentView(R.layout.act_evaluation_succeed);
		setHeader(R.string.title_publish_evaluation);
		tvGoHome = (TextView) findViewById(R.id.tv_go_home);
		tvGoHome.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		super.onClick(v);

		switch (v.getId()) {
		case R.id.common_head_back:
		case R.id.tv_go_home:
			goToHomePage();
			break;
		}
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode==KeyEvent.KEYCODE_BACK) {
			goToHomePage();
		}
		return super.onKeyDown(keyCode, event);
	}
	
	/**
	 * 跳到主页
	 */
	private void goToHomePage() {
//		 TODO 跳转页面 待处理，不确定跳转的位置
//		Intent intent = new Intent();
//		Class<?> homeClass = Account.getInstance().currentIsCustomer() ? TabHomeActivity.class
//				: LandlordTabHomeActivity.class;
//		intent.setClass(this, homeClass);
//		intent.putExtra(AppConstants.KEY_HOME_TAB_INDEX, AppConstants.TAB_INDEX_TENANT_ORDER);
//		startActivity(intent);
//		finish();
	}
}